package com.hudson.common.domain.response;

import com.hudson.common.domain.MessageMeta;

import java.util.List;
import java.util.Objects;

/**
 * @Author: 渔小鲤
 * @DateTime: 2025/7/19 1:41
 **/
public class PushMessageResp {

    private String topic;
    private int queueId;
    private int size;
    private int consumerOffset;
    private List<MessageMeta> messageList;

    public PushMessageResp(String topic, int queueId, int size, int consumerOffset, List<MessageMeta> messageList) {
        this.topic = topic;
        this.queueId = queueId;
        this.size = size;
        this.consumerOffset = consumerOffset;
        this.messageList = messageList;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public int getQueueId() {
        return queueId;
    }

    public void setQueueId(int queueId) {
        this.queueId = queueId;
    }


    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getConsumerOffset() {
        return consumerOffset;
    }

    public void setConsumerOffset(int consumerOffset) {
        this.consumerOffset = consumerOffset;
    }

    public List<MessageMeta> getMessageList() {
        return messageList;
    }

    public void setMessageList(List<MessageMeta> messageList) {
        this.messageList = messageList;
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        PushMessageResp that = (PushMessageResp) o;
        return queueId == that.queueId && size == that.size && consumerOffset == that.consumerOffset && Objects.equals(topic, that.topic) && Objects.equals(messageList, that.messageList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(topic, queueId, size, consumerOffset, messageList);
    }
}
